
<template lang="pug">
  .page
    .search-form.mb-10.pl-10.pr-10
      Row(type="flex" justify="start")
        Col.pr-20.mb-15(:md="{ span: 12 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          span.label-txt.w80 客户名称：
          Input(v-model="name" placeholder="请输入" clearable)
        Col.pr-20.mb-15(:md="{ span: 12 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          span.label-txt.w80 客户所属：
          .choose-saler
            Tooltip(placement="bottom" max-width="200" :disabled="!tipIsShow" theme="light")
              Input.input(v-model="dolderNames" type="text" readonly clearable @on-clear="salersClear")
              div(slot="content")
                .font-14 {{dolderNames}}
            .button(@click="chooseSaler") 选择
          //- Input(v-model="salerName" placeholder="请输入" clearable)
        //- Col.pr-20.mb-15(:md="{ span: 12 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
        //-   span.label-txt.w80 企业性质：
        //-   Select(v-model="character"  placeholder="请选择" clearable)
        //-     Option(v-for="(item, index) in characterArr" :value="item.key" :key="index") {{ item.value }}
        //- Col.pr-20.mb-15(:md="{ span: 12 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
        //-   span.label-txt.w80 企业规模：
        //-   Select(v-model="size"  placeholder="请选择" clearable)
        //-     Option(v-for="(item, index) in sizeArr" :value="item.key" :key="index") {{ item.value }}
        Col.pr-20.mb-15(:md="{ span: 12 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          span.label-txt.w80 所属行业：
          Select(v-model="businessType"  placeholder="请选择" clearable)
            Option(v-for="(item, index) in customerBusinesstype_arr" :value="item.key" :key="index") {{ item.value }}
        //- Col.pr-20.mb-15(:md="{ span: 12 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
        //-   span.label-txt.w80 注册资本：
        //-   Input(type="number" v-model="registerCapital" clearable)
        Col.pr-20.mb-15(:md="{ span: 12 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          span.label-txt.w80 状态：
          RadioGroup.beautiful-radio-group(type="button" v-model="status")
            Radio(label="1") 正常
            Radio(label="2") 关闭
        Col.pr-20.mb-15(:md="{ span: 12 }" :lg="{ span: 12 }" :xl="{ span: 8 }" :xxl="{span: 6}")
          span.label-txt.w80 新建时间：
          DatePicker(:value="xinjianshijian" type="daterange" placement="bottom" placeholder="请选择日期范围" separator="至" @on-change="timeChange")
          Button.ml-15(type="info" @click="searchBtn") 查询
    .pl-20.pr-20.bg-white
      Table.hasTitle-table.beautiful-table(width="100%" :loading="loading" stripe :columns="setThead" :data="listData" @on-selection-change="tableSelectChange")
        div(slot="header")
          .pull-left.table-title-lefttxt
            span.leftText
              | 合作签约数:
              span.text-info.pl-5.pr-5.font-weight {{codeTotal}}
            Divider(type="vertical")
            span.leftText
              | 合作签约转化率:
              span.text-info.pl-5.pr-5.font-weight {{transRate}}%
          .pull-right.table-title-btns
            Button(v-if="hasExportContract" type="info" @click="exportBtn") 导出
        template(slot-scope="{ row, index }" slot="customerName")
          .u-d-info(@click="gotoDetail(row.customerId)") {{row.customerName}}
        template(slot-scope="{ row, index }" slot="ht_fujian")
          .u-d-info.ellipsis(v-for="(item, index) in row.attachments" :key="index" @click="downLoadAttachment(item.id, item.name)") {{item.name}}
          //- Poptip(trigger="hover" title="合同附件" placement="right")
          //-   div(slot="content")
          //-     .u-d-info(v-for="(item, index) in row.attachments" :key="index" @click="downLoadAttachment(item.id, item.name)") {{item.name}}
          //-   Button(size="small") 查看
        template(slot-scope="{ row, index }" slot="communicate")
          Button.mr-5(type="info" size="small" @click="addCommunication(row.customerId)") 添加
          Button.mr-5(type="info" size="small" @click="checkCommunication(row.customerId)") 查看
        template(slot-scope="{ row, index }" slot="action")
          Button.mr-5(v-if="postProductDelivery" type="text" size="small" @click="openCreated(row)") 项目交付
          Button(v-if="!row.isClosed && HRDC_CloseRequirement" type="text" size="small" @click="handleShowCloseModal(row)") 关闭
        .clearfix.pl-20.pr-20(slot="footer")
          Page(:total="codeTotal" :current="PageIndex" :page-size="PageSize" prev-text="上一页" next-text="下一页" @on-change="pageChangeFn" show-total @on-page-size-change="onpageSizeChange" show-sizer :page-size-opts="[10, 20, 30, 50, 100]")
    Modal(v-model="createModal_3" title="待交付信息" width="900")
      Form(ref="form_third" :model="form_third" :rules="ruleValidate" :label-width="130")
        Row(type="flex" justify="start")
          Col(span="12")
            FormItem.mb-5(label="所属合同：")
              b {{contractNo}}
          Col(span="12")
            FormItem.mb-5(label="需求执行地点：" prop="implementPlace")
              Input(v-model="form_third.implementPlace" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="KFC项目编号：" prop="KFCNo")
              Input(v-model="form_third.KFCNo" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="参与人数：" prop="numbers")
              Input(v-model="form_third.numbers" type="number" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="需求类型：" prop="requirementType")
              Select(v-model="form_third.requirementType" placeholder="请选择")
                Option(v-for="item in requirementType" :value="item.value" :key="item.value") {{ item.label }}
          Col(span="12")
            FormItem.mb-5(label="教材模板：" prop="template")
              Select(v-model="form_third.template" placeholder="请选择")
                Option(v-for="item in template" :value="item.value" :key="item.value") {{ item.label }}
          Col(span="12")
            FormItem.mb-5(label="课程/项目名称：" prop="projectName")
              Input(v-model="form_third.projectName" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="布场要求：" prop="isStadium")
              Input(v-model="form_third.isStadium" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="课程开始时间：" prop="startTime")
              DatePicker(v-model="form_third.startTime" type="date" placeholder="请输入" @on-change="startTimeChange_3")
          Col(span="12")
            FormItem.mb-5(label="交通费预算：" prop="transportBudget")
              Input(v-model="form_third.transportBudget" type="number" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="课程结束时间：" prop="endTime")
              DatePicker(v-model="form_third.endTime" type="date" placeholder="请输入" @on-change="endTimeChange_3")
          Col(span="12")
            FormItem.mb-5(label="酒店预算：" prop="hotelBudget")
              Input(v-model="form_third.hotelBudget" type="number" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="负责讲师/顾问：" prop="teacher")
              Input(v-model="form_third.teacher" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="茶歇预算：" prop="teabreakBudget")
              Input(v-model="form_third.teabreakBudget" type="number" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="讲师联系方式：" prop="teacherTel")
              Input(v-model="form_third.teacherTel" type="number" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="教材预算：" prop="textbookBudget")
              Input(v-model="form_third.textbookBudget" type="number" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="课酬金额：" prop="payment")
              Input(v-model="form_third.payment" type="number" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="客户对接人：" prop="contactName")
              Select(v-model="form_third.contactName" placeholder="请选择")
                Option(v-for="(item, index) in contact_arr" :value="item.name" :key="index") {{ item.name }}
          Col(span="24")
            FormItem.mb-5(label="备注：" prop="name")
              Input(v-model="form_third.remark" type="textarea" placeholder="请输入")
          //- Col(span="24")
          //-   FormItem(label="完成时间：" prop="completeTime")
          //-     DatePicker(:value="form_third.completeTime" type="datetime" format="yyyy-MM-dd HH:mm" placeholder="请选择" style="display:block" @on-change="completeTimeChange")
      template(slot="footer")
        Button(type="info" @click="handleSubmit_3('form_third')") 提交
        Button(@click="createModal_3 = false") 取消
    Modal(v-model="createModal_1" title="待交付信息" width="900")
      Form(ref="form_first" :model="form_first" :rules="ruleValidate" :label-width="150")
        Row(type="flex" justify="start")
          Col(span="12")
            FormItem.mb-5(label="所属合同：")
              b {{contractNo}}
          Col(span="12")
            FormItem.mb-5(label="合同年限：")
              span {{duration}}
          Col(span="12")
            FormItem.mb-5(label="需求类型：" prop="cooperateType")
              Select(v-model="form_first.cooperateType" placeholder="请选择")
                Option(v-for="(item, index) in cooperateType_arr" :value="item.key" :key="index") {{ item.value }}
          Col(span="12")
            FormItem.mb-5(label="合同开始时间：")
              span {{startDate}}
          Col(span="12")
            FormItem.mb-5(label="人事负责人姓名：" prop="HRContactName")
              Input(v-model="form_first.HRContactName" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="合同结束时间：")
              span {{endDate}}
          Col(span="12")
            FormItem.mb-5(label="人事负责人电话：" prop="HRContactPhone")
              Input(v-model="form_first.HRContactPhone" placeholder="请输入")
          Col(span="12")
            FormItem.mb-5(label="指派角色" prop="serverId")
              Select(v-model="form_first.serverId" placeholder="请选择" filterable clearable :label-in-value="true" @on-change="serverChange")
                Option(v-for="(item, index) in server_arr" :value="item.key" :key="index") {{ item.value }}
          Col(span="12")
            FormItem.mb-5(label="客户所在城市：" prop="city_arr")
              Cascader(v-model="form_first.city_arr" placeholder="请选择参保地区" :filterable="true" :data="areaArr" :change-on-select="true" :load-data="loadDataCity" style="flex:1;" @on-change="cityChange")
          Col(span="12")
            FormItem.mb-5(label="合同附件：")
              Poptip(trigger="hover" title="方案内容")
                div(slot="content")
                  .u-d-info(v-for="(item, index) in fileArr" :key="index" @click="downLoadAttachment(item.id, item.name)") {{item.name}}
                Button(size="small") 查看
          Col(span="24")
            FormItem.mb-5(label="备注：")
              Input(v-model="form_first.remark" type="textarea" placeholder="请输入")
      template(slot="footer")
        Button(type="info" @click="handleSubmit_1('form_first')") 提交
        Button(@click="createModal_1 = false") 取消
    createCommunication(ref="createCommunication" :customerId="customerId" :contact_arr="contact_arr" :communicationtype="communicationtype")
    checkCommunication(ref="checkCommunication" :customerId="customerId" :communicationList="communicationList" :communicationTotal="communicationTotal" @get-list="getCommunicationList")
    visibvleTreeList(ref="treeModal" :treeData="treeData" @on-change="getSalerId")
    CloseModal(ref="CloseModal" @query="getList")
</template>

<script>
import dataApi from '@/api/data.js'
import HRDCCustomerApi from '@/api/HRDCCustomer.api.js'
import Mixin from '../saleMixin.js'
import createCommunication from '@/view/oti-center/HRDC-common/communication/create.vue'
import checkCommunication from '@/view/oti-center/HRDC-common/communication/check.vue'
import CloseModal from '../close.vue'

export default {
  name: 'hrdc-demand-D',
  data () {
    return {
      transRate: 0, // 转化率
      areaArr: [],
      name: '',
      salerName: '',
      character: '', // 企业性质
      size: '', // 企业规模
      businessType: '', // 所属行业
      registerCapital: '', // 注册资本
      contact_arr: [], // 联系人数组
      contractNo: '', // 合同编号
      requirementID: '', // 需求id
      requirementNo: '', // 需求编号
      customerName: '', // 客户名称
      contractPayment: '', // 合同金额
      createrName: '', // 创建者
      fileArr: [], // 合同附件
      startDate: '', // 合同起止时间
      endDate: '', // 合同结束时间
      duration: '', // 合同年限
      server_arr: [], // 客服数组
      cooperateType_arr: [], // 合作类型数组
      hasFile: false,
      xinjianshijian: [], // 新建时间
      thead: ['selection', 'requirementCode', 'brief', 'customerName', 'ht_code', 'ht_signTime', 'ht_amt', 'createrName', 'status', 'businessTypeName', 'closedReason', 'closedByName', 'createTime', 'ht_fujian', 'communicate', 'action'],
      listData: [],
      loading: false,
      codeTotal: 0,
      PageIndex: 1,
      PageSize: 10,
      status: '1',
      createModal_1: false, // 一类产品弹窗
      createModal_3: false, // 三类产品弹窗
      requirementType: [
        {
          value: '单课',
          label: '单课'
        },
        {
          value: '多课',
          label: '多课'
        },
        {
          value: '咨询',
          label: '咨询'
        }
      ],
      template: [
        {
          value: '安博固定模板',
          label: '安博固定模板'
        },
        {
          value: '肯家固定模板',
          label: '肯家固定模板'
        },
        {
          value: '其他模板',
          label: '其他模板'
        }
      ],
      form_first: {
        cooperateType: '', // 需求类型
        HRContactName: '', // 人事负责人姓名
        HRContactPhone: '', // 人事负责人电话
        cityId: '',
        cityName: '',
        city_arr: [],
        areaPath: '',
        serverId: '',
        serverName: '',
        remark: ''
        // completeTime: this.$moment(new Date()).format('YYYY-MM-DD HH:mm')
      },
      form_third: {
        KFCNo: '', // KFC项目编号
        requirementType: '', // 需求类型
        projectName: '', // 项目名称
        startTime: '', // 开始时间
        endTime: '', // 结束时间
        teacher: '', // 负责讲师
        teacherTel: '', // 讲师联系方式
        payment: '', // 课酬金额
        implementPlace: '', // 需求执行地点
        numbers: '', // 参与人数
        template: '', // 教材模板
        isStadium: '', // 布场要求
        transportBudget: '', // 交通预算
        hotelBudget: '', // 酒店预算
        teabreakBudget: '', // 茶歇预算
        textbookBudget: '', // 教材预算
        contactName: '', // 对接人名字
        remark: '' // 备注
        // completeTime: this.$moment(new Date()).format('YYYY-MM-DD HH:mm')
      },
      ruleValidate: {
        KFCNo: [
          { required: true, trigger: 'blur' }
        ],
        requirementType: [
          { required: true, trigger: 'change' }
        ],
        projectName: [
          { required: true, trigger: 'blur' }
        ],
        startTime: [
          { required: true, trigger: 'change' }
        ],
        endTime: [
          { required: true, trigger: 'change' }
        ],
        teacher: [
          { required: true, trigger: 'blur' }
        ],
        teacherTel: [
          { required: true, trigger: 'blur' }
        ],
        payment: [
          { required: true, trigger: 'blur' }
        ],
        implementPlace: [
          { required: true, trigger: 'blur' }
        ],
        numbers: [
          { required: true, trigger: 'blur' }
        ],
        template: [
          { required: true, trigger: 'change' }
        ],
        isStadium: [
          { required: true, trigger: 'blur' }
        ],
        transportBudget: [
          { required: true, trigger: 'blur' }
        ],
        hotelBudget: [
          { required: true, trigger: 'blur' }
        ],
        teabreakBudget: [
          { required: true, trigger: 'blur' }
        ],
        textbookBudget: [
          { required: true, trigger: 'blur' }
        ],
        contactName: [
          { required: true, trigger: 'change' }
        ],
        serverId: [
          { required: true, trigger: 'change' }
        ],
        HRContactPhone: [
          { required: true, trigger: 'blur' }
        ],
        HRContactName: [
          { required: true, trigger: 'blur' }
        ],
        cooperateType: [
          { required: true, trigger: 'change' }
        ],
        city_arr: [
          { required: true, type: 'array', min: 1, trigger: 'change' }
        ],
        completeTime: [
          { required: true, message: '完成时间不能为空', trigger: 'change' }
        ]
      }
    }
  },
  components: {
    createCommunication,
    checkCommunication,
    CloseModal
  },
  mixins: [Mixin],
  computed: {
    actionArr () {
      let arr = this.$store.state.user.actionAccess.map(item => {
        return item.code
      })
      return arr
    },
    setThead () {
      return this.getTableColumns(this.thead)
    },
    // 项目交付
    postProductDelivery () {
      return this.actionArr.indexOf('PostProductDelivery') > -1
    },
    // 关闭
    HRDC_CloseRequirement () {
      return this.actionArr.indexOf('HRDC_CloseRequirement') > -1
    },
    // 导出
    hasExportContract () {
      return this.actionArr.indexOf('ExportContract') > -1
    },
  },
  created () {
    this.getList()
    console.log(this.sizeArr)
  },
  watch: {
    $route (to, from) {
      if (to.name === 'hrdc-demand-D') {
        this.getList()
      }
    }
  },
  methods: {
    // 获取列表数据
    getList () {
      this.loading = true
      HRDCCustomerApi.GetSalesContractItems({
        name: this.name,
        salerName: this.salerName,
        HolderIds: this.salesIds,
        Character: this.character,
        Size: this.size,
        BusinessType: this.businessType,
        RegisterCapital: this.registerCapital,
        Status: this.status,
        RequirementBeginTime: this.xinjianshijian[0],
        RequirementEndTime: this.xinjianshijian[1],
        PageIndex: this.PageIndex,
        PageSize: this.PageSize
      }).then(res => {
        this.loading = false
        if (res.data.success) {
          this.listData = res.data.data
          this.codeTotal = res.data.totalRows
          this.transRate = res.data.extraInfo.transRate.toFixed(2)
        } else {
          
          this.$Message.error({
            content: res.data.message,
            duration: 10,
            closable: true
          })
        }
      })
    },
    // 获取联系人列表
    getContactList () {
      console.log('获取联系人列表')
      HRDCCustomerApi.ContacterList({
        customerId: this.customerId,
        PageIndex: 0,
        PageSize: 100
      }).then(res => {
        if (res.data.success) {
          this.contact_arr = res.data.data
        } else {
          this.$Message.error({
            content: res.data.message,
            duration: 10,
            closable: true
          })
        }
      })
    },
    openCreated (val) {
      console.log('val: ', val)
      this.contractNo = val.code
      this.requirementID = val.requirementId // 需求id
      this.requirementNo = val.requirementCode // 需求编号
      this.customerId = val.customerId
      this.customerName = val.customerName // 客户名称
      this.contractPayment = val.amt // 合同金额
      this.createrName = val.createrName // 创建者
      if (val.deliveryLevel === 1) {
        this.getProvince()
        this.getEnum()
        this.serverDown()
        this.duration = val.duration
        this.startDate = val.startDate
        this.endDate = val.endDate
        this.fileArr = val.attachments
        this.createModal_1 = true
      } else if (val.deliveryLevel === 3) {
        this.createModal_3 = true
      }
      this.getContactList()
    },
    startTimeChange_3 (val) {
      this.form_third.startTime = val
    },
    endTimeChange_3 (val) {
      this.form_third.endTime = val
    },
    startTimeChange_1 (val) {
      // this.form_third.startTime = val
    },
    endTimeChange_1 (val) {
      // this.form_third.endTime = val
    },
    completeTimeChange (val) {
      this.form_third.completeTime = val
      this.form_first.completeTime = val
    },
    // 新增三层楼交付
    postProductDeliveryFor3 () {
      HRDCCustomerApi.PostProductDeliveryFor3(Object.assign({
        requirementID: this.requirementID,
        requirementNo: this.requirementNo,
        customerName: this.customerName,
        customerId: this.customerId,
        contractNo: this.contractNo,
        contractPayment: this.contractPayment,
        saler: this.createrName
      }, this.form_third)).then(res => {
        console.log(res)
        if (res.data.success) {
          this.$Message.success(res.data.message)
          this.createModal_3 = false
        } else {
          
          this.$Message.error({
            content: res.data.message,
            duration: 10,
            closable: true
          })
        }
      })
    },
    // 新增一层楼交付
    postProductDeliveryFor1 () {
      HRDCCustomerApi.PostProductDeliveryFor1(Object.assign({
        requirementID: this.requirementID,
        customerId: this.customerId
      }, this.form_first)).then(res => {
        console.log(res)
        if (res.data.success) {
          this.$Message.success(res.data.message)
          this.createModal_1 = false
        } else {
          this.$Message.error({
            content: res.data.message,
            duration: 10,
            closable: true
          })
        }
      })
    },
    handleSubmit_3 (name) {
      this.$refs[name].validate((valid) => {
        if (valid) {
          this.postProductDeliveryFor3()
        }
      })
    },
    handleSubmit_1 (name) {
      this.$refs[name].validate((valid) => {
        if (valid) {
          this.postProductDeliveryFor1()
        }
      })
    },
    createHandleUpload (file) {
      this.fileArr.push(file)
      this.hasFile = false
      console.log(this.fileArr)
      return false
    },
    deleteFile (index) {
      this.fileArr.splice(index, 1)
    },
    // 查询
    searchBtn () {
      this.PageIndex = 1
      this.getList()
    },
    // 客户导入
    importBtn () {

    },
    tableSelectChange () {

    },
    pageChangeFn (val) {
      this.PageIndex = val
      this.getList()
    },
    onpageSizeChange (val) {
      this.PageSize = val
      this.getList()
    },
    serverChange (val) {
      if (val) {
        this.form_first.serverName = val.label
      } else {
        this.form_first.serverName = ''
      }
    },
    cityChange (value, selectedData) {
      console.log(value, selectedData)
      this.form_first.areaPath = value.join(',')
      if (value.length > 0) {
        this.form_first.cityId = value[value.length - 1]
        this.form_first.cityName = selectedData[selectedData.length - 1].name
      } else {
        this.form_first.cityId = ''
        this.form_first.cityName = ''
      }
    },
    /**
     * 分级查询地区
     */
    loadDataCity (val, callback) {
      val.loading = true
      if (val.levelID === 2) {
        dataApi.getCity({ parentId: val.value }).then(res => {
          val.children = res.data.data.map(item => {
            return {
              ...item,
              label: item.name,
              value: item.id,
              children: []
              // loading: false
            }
          })
          val.loading = false
          callback()
        })
      } else {
        // dataApi.getArea({parentId: val.value}).then(res => {
        //   val.children = res.data.data.map(item => {
        //     return {...item, label: item.name, value: item.id}
        //   })
        //   val.loading = false
        //   callback()
        // })
      }
    },
    /**
     * 查询所有省
     */
    getProvince () {
      dataApi.getProvince().then(res => {
        this.areaArr = res.data.data.map(item => {
          return {
            ...item,
            label: item.name,
            value: item.id,
            children: [],
            loading: false
          }
        })
      })
    },
    /**
     * server所属客服下拉数据
     */
    serverDown () {
      let data = {
        pageIndex: 1,
        pageSize: 1000
      }
      dataApi.postServers(data).then(res => {
        this.server_arr = res.data[0].items
      })
    },
    // 下载附件
    downLoadAttachment (id, fileName) {
      HRDCCustomerApi.DownLoadAttachment({
        id: id
      }).then(res => {
        let blob = new Blob([res.data], { type: 'application/octet-stream' })
        if ('download' in document.createElement('a')) {
          let objectUrl = URL.createObjectURL(blob)
          console.log(objectUrl)
          // let objectUrl = URL.createObjectURL(new Blob([res.data],{type: 'application/octet-stream'}))
          // 文件地址
          const link = document.createElement('a')
          link.download = fileName
          link.href = objectUrl
          link.click()
        } else {
          navigator.msSaveBlob(blob, fileName)
        }
      })
    },

    handleShowCloseModal(row) {
      this.$refs.CloseModal.show(row)
      this.$refs.CloseModal.modalType = 'D'
    },

    // 客户导出
    exportBtn () {
      HRDCCustomerApi.exportContract({
        selectedIds: this.ids,
        name: this.name,
        salerName: this.salerName,
        HolderIds: this.salesIds,
        Character: this.character,
        Size: this.size,
        Status: this.status,
        BusinessType: this.businessType,
        RegisterCapital: this.registerCapital,
        RequirementBeginTime: this.xinjianshijian[0],
        RequirementEndTime: this.xinjianshijian[1],
      }).then(res => {
        if (res.data.success) {
          let objectUrl = res.data.data
          console.log(objectUrl)
          const link = document.createElement('a')
          link.download = ''
          link.href = objectUrl
          link.click()
        } else {
          this.$Message.error({
            content: res.data.message,
            duration: 10,
            closable: true
          })
        }
      })
    },

    timeChange (event) {
      console.log('时间改变 event: ', event)
      this.xinjianshijian = event
    }
  }
}
</script>

<style>

</style>
